/**
 * Created by weikexin .
 * description:
 **/
import {HTTP} from '../util/http'

class Publish extends HTTP {
    publishStatus(params = {}, success) {
        let url = 'publish/status'
        let data = Object.assign({},
            params,
            {
                userId: wx.getStorageSync('userInfo').user_id || 0
            })
        this.request({
            url: url,
            data: data,
            success
        })
    }

    publishShare(params = {}, success) {
        let url = 'publish/share'
        let data = Object.assign({},
            params,
            {
                userId: wx.getStorageSync('userInfo').user_id || 0
            })
        this.request({
            url: url,
            data: data,
            success
        })
    }

    deletePublish(params = {}, success) {
        let url = 'publish/delete'
        let data = Object.assign({},
            params,
            {
                userId: wx.getStorageSync('userInfo').user_id || 0
            })
        this.request({
            url: url,
            data: data,
            success
        })
    }

    getMainSwipre (success) {
      let url = 'pub/banner'
      this.request({
        url: url,
        data: {
            rnd: '11'
        },
        success
      })
    }

     callTimes (params = {},success) {
      let url = 'common/callTimes'
      this.request({
        url: url,
        data: params,
        success
      })
    }

    getJobsStationCategory (params = {},success) {
      let url = 'DataDictionary/selectStationInfo'
      this.request({
        url: url,
        data: params,
        success
      })
    }

    getPublicTypes (params = {},success) {
      let url = 'DataDictionary/selectTagDateInfo'
      this.request({
        url: url,
        data: params,
        success
      })
    }

    getSupplyClassify (params = {},success) {
      let url = 'DataDictionary/querySupplierClassify'
      this.request({
        url: url,
        data: params,
        success
      })
    }

    homeRecommend(params = {}, success) {
      let url = 'CollectManagement/queryRecommendList'
      let data = Object.assign({
        userId: wx.getStorageSync('userInfo').user_id || 0,
      },
          params
      )
      this.request({
          url: url,
          data: data,
          success
      })
  }


  getPhoneNumber(params = {}, success) {
      let url = 'CollectManagement/bindAXN'
      let data = Object.assign({
        userId: wx.getStorageSync('userInfo').user_id || 0,
      },
          params
      )
      this.request({
          url: url,
          data: data,
          success
      })
  }


shareStick(params = {}, success) {
    let url = 'CollectManagement/shareStick'
    let data = Object.assign({
      userId: wx.getStorageSync('userInfo').user_id || 0,
    },
      params
    )
    this.request({
      url: url,
      data: data,
      success
    })
  }

sendMsg(params = {}, success) {
    let url = 'SendSms/getSendSms'
    let data = params
    this.request({
      url: url,
      urlData: data,
      method: 'POST',
      success
    })
  }

	getStoreClassify(params, success) {
		let url = 'goods/category'
		this.request({
      url,
      data: {
        rnd: 123
      },
			oldURL: true,
			success
		})
	}

}

export {Publish}
